class TravelQuery:
    def __init__(self, travel_id=None, travel_reason=None, travel_detail=None, apply_date=None, start_date=None,
                 end_date=None, food_cost=None, transport_cost=None, hotel_cost=None, cost_detail=None,
                 advance_payment=None, user_id=None):
        self.travel_id = travel_id
        self.travel_reason = travel_reason
        self.travel_detail = travel_detail
        self.apply_date = apply_date
        self.start_date = start_date
        self.end_date = end_date
        self.food_cost = food_cost
        self.transport_cost = transport_cost
        self.hotel_cost = hotel_cost
        self.cost_detail = cost_detail
        self.advance_payment = advance_payment
        self.user_id = user_id

    def to_dict(self):
        """Converts the Travel instance into a dictionary."""
        return {
            'travel_id': self.travel_id,
            'travel_reason': self.travel_reason,
            'travel_detail': self.travel_detail,
            'apply_date': self.apply_date.isoformat() if self.apply_date else None,
            'start_date': self.start_date.isoformat() if self.start_date else None,
            'end_date': self.end_date.isoformat() if self.end_date else None,
            'food_cost': self.food_cost,
            'transport_cost': self.transport_cost,
            'hotel_cost': self.hotel_cost,
            'cost_detail': self.cost_detail,
            'advance_payment': self.advance_payment,
            'user_id': self.user_id
        }
